package com.ruoyi.net.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.domain.ElementBusiMtnChannelOam;
import com.ruoyi.net.domain.ElementBusiMtnChannelOamListVo;
import com.ruoyi.net.mapper.ElementBusiMtnChannelOamMapper;
import com.ruoyi.net.service.IElementBusiMtnChannelOamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 网元-业务-MTN Channel-oamService业务层处理
 * 
 * @author tony
 * @date 2024-12-08
 */
@Service
public class ElementBusiMtnChannelOamServiceImpl implements IElementBusiMtnChannelOamService 
{
    @Autowired
    private ElementBusiMtnChannelOamMapper elementBusiMtnChannelOamMapper;

    /**
     * 查询网元-业务-MTN Channel-oam
     * 
     * @param id 网元-业务-MTN Channel-oam主键
     * @return 网元-业务-MTN Channel-oam
     */
    @Override
    public ElementBusiMtnChannelOam selectElementBusiMtnChannelOamById(String id)
    {
        return elementBusiMtnChannelOamMapper.selectElementBusiMtnChannelOamById(id);
    }

    /**
     * 查询网元-业务-MTN Channel-oam列表
     * 
     * @param elementBusiMtnChannelOam 网元-业务-MTN Channel-oam
     * @return 网元-业务-MTN Channel-oam
     */
    @Override
    public List<ElementBusiMtnChannelOamListVo> selectElementBusiMtnChannelOamList(ElementBusiMtnChannelOam elementBusiMtnChannelOam)
    {
        return elementBusiMtnChannelOamMapper.selectElementBusiMtnChannelOamList(elementBusiMtnChannelOam);
    }

    /**
     * 新增网元-业务-MTN Channel-oam
     * 
     * @param elementBusiMtnChannelOam 网元-业务-MTN Channel-oam
     * @return 结果
     */
    @Override
    public int insertElementBusiMtnChannelOam(ElementBusiMtnChannelOam elementBusiMtnChannelOam)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementBusiMtnChannelOam.getId())) {
            elementBusiMtnChannelOam.setId(uuid);
        }
        elementBusiMtnChannelOam.setCreateBy(SecurityUtils.getUsername());
        elementBusiMtnChannelOam.setCreateTime(DateUtils.getNowDate());
        elementBusiMtnChannelOam.setUpdateBy(SecurityUtils.getUsername());
        elementBusiMtnChannelOam.setUpdateTime(DateUtils.getNowDate());
        return elementBusiMtnChannelOamMapper.insertElementBusiMtnChannelOam(elementBusiMtnChannelOam);
    }

    /**
     * 修改网元-业务-MTN Channel-oam
     * 
     * @param elementBusiMtnChannelOam 网元-业务-MTN Channel-oam
     * @return 结果
     */
    @Override
    public int updateElementBusiMtnChannelOam(ElementBusiMtnChannelOam elementBusiMtnChannelOam)
    {
        elementBusiMtnChannelOam.setUpdateBy(SecurityUtils.getUsername());
        elementBusiMtnChannelOam.setUpdateTime(DateUtils.getNowDate());
        return elementBusiMtnChannelOamMapper.updateElementBusiMtnChannelOam(elementBusiMtnChannelOam);
    }

    /**
     * 批量删除网元-业务-MTN Channel-oam
     * 
     * @param ids 需要删除的网元-业务-MTN Channel-oam主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiMtnChannelOamByIds(String[] ids)
    {
        return elementBusiMtnChannelOamMapper.deleteElementBusiMtnChannelOamByIds(ids);
    }

    /**
     * 删除网元-业务-MTN Channel-oam信息
     * 
     * @param id 网元-业务-MTN Channel-oam主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiMtnChannelOamById(String id)
    {
        return elementBusiMtnChannelOamMapper.deleteElementBusiMtnChannelOamById(id);
    }
}
